<script charset="utf-8" src="<?=base_url()?>resource/plugins/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<?=base_url()?>resource/plugins/kindeditor/lang/<?=MYLANG=='sc'?'zh_CN':'en'; ?>.js"></script>
<script type="text/javascript" src="<?=base_url()?>resource/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
//表单验证
function product_submit() {
    /*----------------公共修改-------------------*/
    //外观状况
    var damage_id = $("input[name='damage_id']:checked").val();
    if(!damage_id){
        alert('请选择外观状况');
        return false;
    }

    //外观状况描述
    if($("textarea[name=wgzkms]").val()==''){
        //alert('请输入外观状况描述');
        //return false;
    }

    //质保类型
    /*
    var is_guarantee = $("input[name='']:checked").val();
    if(!){
        alert('请选择质保类型');
        return false;
    }
    */
    //描述是否一致
    var is_description = $("input[name='is_description']:checked").val();
    if(!is_description){
        alert('请选择描述是否一致');
        return false;
    }

    //附件
    var fujian = $("#fujianListId :checkbox:checked");
    if(fujian.length<=0){
        alert('请选择附件');
        return false;
    }

    //故障
    var guzhang = $("#guzhangListId :checkbox:checked");
    if(guzhang.length<=0){
        alert('请选择故障');
        return false;
    }
	return true;
}

$(function(){
    $("input[name='damage_id']").click(function(){
        //$('#damageOrdered').css({display:'block'});
        $('#damageOrdered').show();
    })
    if('<?=$productFirst['damage_id']?>' !== ''){
        $('#damageOrdered').show();
    }
})


KindEditor.ready(function(K) {
    window.editor = K.create('.editor_id',{
        resizeType : 1,
        allowPreviewEmoticons : false,
        allowImageUpload : true,
        width : '800px;',
        Height : '250px',
        langType : '<?=MYLANG=='sc'?'zh_CN':'en'; ?>',
        items : [
            'forecolor', 'hilitecolor','formatblock','bold','|', 'image', 'link']
    });
});

</script>


<!--top结束-->
<div class="mian">
	<div class="mian1">
		<div class="mian2">
            <!--left start-->
            <?php $this->load->view('defaults/common/left');?>
            <!--left end-->
			<!--right start-->
			<div class="right">
                <!--breadcrumb start-->
                <div class="righta"><?=$this->breadcrumb->generateHTML();?> </div>
                <!--breadcrumb end-->
				<!-- contents start -->
				<div id="contents" style="width: 1200px;">
                    <!--质检数据 start-->
					<div id="contents_container" style="width: 1200px;">
					<form action="<?=blang_url('products/product/'.$post_type)?>" method="post" name="productForm" onsubmit="return product_submit()" autocomplete="off" >
						<table cellpadding="0" cellspacing="0" id="table_forms" border="1" style="width: 1200px;">
                            <tr>
                                <th class="forms_left"><span class="sort_params0">*</span><?=lang('product_wgzk')?>:</td>
                                <td>
                                    <?php foreach ($damageList as $rs):?>
                                        <input type="radio" name="damage_id" value="<?=$rs['damage_id']?>" <?=$ckdwgzk[$rs['damage_id']]?> /><?=$rs['damage_name']?>&nbsp;&nbsp;
                                    <?php endforeach;?>
                                    <div id="damageOrdered" style="display:none ;margin-left:18px;">
                                        <ul style="list-style: none;">
                                            <li>
                                                <?=lang('damage_qcp')?>:
                                                  <input type="radio" name="screen" value="1" <?=$productFirst['optscreen1']?> ><?=lang('damage_qcps')?>
                                                  <input type="radio" name="screen" value="2" <?=$productFirst['optscreen2']?> ><?=lang('damage_qcxgh')?>
                                                  <input type="radio" name="screen" value="3" <?=$productFirst['optscreen3']?> ><?=lang('damage_qcdgh')?>
                                            </li>
                                            <li>
                                                <?=lang('damage_qcqg')?>:
                                                <input type="radio" name="front" value="1" <?=$productFirst['optfront1']?> ><?=lang('damage_qcps')?>
                                                <input type="radio" name="front" value="2" <?=$productFirst['optfront2']?> ><?=lang('damage_qcxgh')?>
                                                <input type="radio" name="front" value="3" <?=$productFirst['optfront3']?> ><?=lang('damage_qcdgh')?>
                                            </li>
                                            <li>
                                                <?=lang('damage_qczk')?>:
                                                <input type="radio" name="frame" value="1" <?=$productFirst['optframe1']?> ><?=lang('damage_qcps')?>
                                                <input type="radio" name="frame" value="2" <?=$productFirst['optframe2']?> ><?=lang('damage_qcxgh')?>
                                                <input type="radio" name="frame" value="3" <?=$productFirst['optframe3']?> ><?=lang('damage_qcdgh')?>
                                            </li>
                                            <li>
                                                <?=lang('damage_qchg')?>:
                                                <input type="radio" name="back" value="1" <?=$productFirst['optback1']?> ><?=lang('damage_qcps')?>
                                                <input type="radio" name="back" value="2" <?=$productFirst['optback2']?> ><?=lang('damage_qcxgh')?>
                                                <input type="radio" name="back" value="3" <?=$productFirst['optback3']?> ><?=lang('damage_qcdgh')?>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left"><?=lang('product_wgzkimg')?>:</td>
                                <td>
                                    <textarea name="wgzkms" class="editor_id" ><?=$productFirst['wgzkms']?></textarea>
                                </td>
                            </tr>
                            <?php if($dxBrandList && is_array($dxBrandList)):?>
                                <tr>
                                    <th class="forms_left"><?=lang('product_dxppbnts')?>:</td>
                                    <td>
                                        <?php foreach ($dxBrandList as $val):?>
                                            <?=$val?> &nbsp;&nbsp;|&nbsp;&nbsp;
                                        <?php endforeach;?>
                                    </td>
                                </tr>
                            <?php endif;?>
                            <tr style="display: none;">
                                <th class="forms_left"><span class="sort_params0">*</span><?=lang('product_zbtype')?>:</td>
                                <td >
                                    <input type="radio" name="is_guarantee" value="0" <?=$ckdsfzb[0]?> /><?=lang('product_cpbw')?>
                                    <input type="radio" name="is_guarantee" value="1" <?=$ckdsfzb[1]?> /><?=lang('product_ptbn')?>
                                    <input type="radio" name="is_guarantee" value="2"  <?=$ckdsfzb[2]?> /><?=lang('product_ppbn')?> &nbsp;
                                    <?php if(isset($warrantyStr)): ?>
                                        <?=$warrantyStr?>
                                    <?php endif; ?>
                                </td>
                            </tr>

                            <tr>
                                <th class="forms_left"><?=lang('product_zbtype')?>:</td>
                                <td>
                                    <input type="radio" name="is_guarantee" value="0" <?=$ckdsfzb[0]?> /><?=lang('product_cpbw')?>
                                    <input type="radio" name="is_guarantee" value="1" <?=$ckdsfzb[1]?> /><?=lang('product_ptbn')?>
                                </td>
                            </tr>

                            <tr>
                                <th class="forms_left"><span class="sort_params0">*</span><?=lang('product_mssfyz')?>:</td>
                                <td>
                                    <input type="radio" name="is_description" value="0"  <?=$ckdmssfyz[0]?> />No &nbsp;
                                    <input type="radio" name="is_description" value="1" <?=$ckdmssfyz[1]?> />Yes
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left"><span>*</span><?=lang('product_sjfj')?>:</td>
                                <td>
                                    <div id="fujianListId">
                                        <?php foreach ($fujianList as $rs):?>
                                            <input type="checkbox" name="attachment_id[]" value="<?=$rs['attachment_id']?>" <?=$ckdfujian[$rs['attachment_id']]?>  />
                                            <?=$rs['attachment_name']?>&nbsp;&nbsp;
                                        <?php endforeach;?>
                                        <br><?=lang('product_qtfj')?>：
                                        <input type="text" name="other_fujian_name" value="" placeholder="<?=lang('product_gkfh')?>" /> &nbsp; 如:nameA;nameB;nameC
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <th class="forms_left"><span>*</span><?=lang('product_gz')?>:</td>
                                <td >
                                    <div id="guzhangListId">
                                        <table>
                                        <?php foreach ($guzhangList as $key=>$rs):?>
                                        <?php if(($key%7)==0){?>
                                        <tr>
                                            <?php }?>
                                            <td>
                                            <input type="checkbox" name="fault_id[]" value="<?=$rs['fault_id']?>" <?=$ckdguzhang[$rs['fault_id']]?> />
                                            <?=$rs['fault_name']?>
                                            </td>
                                            <?php if(($key%7)==6){?>
                                                </tr>
                                            <?php } ?>
                                        <?php endforeach;?>
                                        </table>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <th><?=lang('product_khbz')?>:</th>
                                <td><textarea class="editor_id" name="remark_customer" ><?=$productFirst['remark_customer']?></textarea></td>
                            </tr>
                            <?php if($productFirst['remark_cn']):?>
                                <tr>
                                    <th><?=lang('product_kfbz')?>:</th>
                                    <td><?=$productFirst['remark_cn']?></td>
                                </tr>
                            <?php endif; ?>
                            <tr>
                                <th><?=$productFirst['remark_cn']?lang('product_zjbz'):lang('product_kfbz');?>:</th>
                                <td><textarea class="editor_id" name="append_remark" ></textarea></td>
                            </tr>
                            <tr>
                                <th><?=lang('product_ywbzkf')?>:</th>
                                <td><textarea class="editor_id" name="remark_en"  ><?=$productFirst['remark_en']?></textarea></td>
                            </tr>

						    <tr>
						      <td align="center" colspan="2" class="sub_padding_right">
                                <input type="hidden" name="id" value="<?=$productFirst['product_id']?>" />
                                  <input type="hidden" name="maintain_id" value="<?=$productFirst['maintain_id']?>" />
								<input type="submit" value="<?=lang('public_tj')?>" name="submits" style="margin-right: 20px;width: 150px; height: 30px;"/>
						      </td>
						    </tr>
					   </table>
					</form>
				   </div>

                 <!--订单信息-->
                    <div id="ct_header" style="width: 1200px;">
                        <table cellpadding="0" cellspacing="0" id="table_forms" border="1" style="width: 1200px;">
                            <tr>
                                <td ><?=lang('order_wxdh')?>：<?=$productFirst['maintain_id']?></td>
                            </tr>
                            <tr>
                                <td >
                                    <?=lang('product_cpid')?>：<?=$productFirst['product_id']?>&nbsp;&nbsp;
                                    <?=lang('product_lyid')?>：<?=$productFirst['source_product_id']?>
                                </td>
                            </tr>
                            <tr>
                                <td >
                                    <?=lang('product_cptype')?>：<?=$productFirst['sort_name']?>
                                </td>
                            </tr>
                            <?php if($productFirst['sort_id']==1 || $productFirst['sort_id']==2):?>
                                <tr>
                                    <td ><?=lang('product_sspp')?>：<?=$productFirst['brand_name']?>
                                        <?=$productFirst['other_brand_name']?>
                                    </td>
                                </tr>
                                <tr>
                                    <td >
                                        <?=lang('product_cpxh')?>：<?=$productFirst['product_model']?>&nbsp;&nbsp;&nbsp;
                                        SKU：<?=$productFirst['sku']?>&nbsp;&nbsp;&nbsp;
                                        IMEI：<?=$productFirst['imei']?>
                                    </td>
                                </tr>
                            <?php elseif($product_sort_id==3):?>
                                <tr>
                                    <td >size：<?=$productFirst['size']?></td>
                                </tr>
                                <tr>
                                    <td >color：<?=$productFirst['color']?></td>
                                </tr>
                                <tr>
                                    <td >bluetooth：<?=$productFirst['is_bluetooth']?'YES':'NO'; ?></td>
                                </tr>
                                <tr>
                                    <td >remote control：<?=$productFirst['is_yaokong']?'YES':'NO'; ?></td>
                                </tr>
                            <?php endif;?>
                            <tr>
                                <td ><?=lang('product_wgzk')?>：<?=$productFirst['damage_name']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_zbtype')?>：<?php switch($productFirst['is_guarantee']){
                                        case 0:
                                            echo ''.lang('product_ppbn');
                                            break;
                                        case 1:
                                            echo ''.lang('product_ptbn');
                                            break;
                                        case 2:
                                            echo ''.lang('product_bw');
                                            break;
                                    }?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_mssfyz')?>：<?=$productFirst['is_description']?'Yes':'No'?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_zwbzkf')?>：<?=$productFirst['remark_cn']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_ywbzkf')?>：<?=$productFirst['remark_en']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_khbz')?>：<?=$productFirst['remark_customer']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_wxsbz')?>：<?=$productFirst['repair_remark']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_tjr')?>：<?=$productFirst['add_user']?></td>
                            </tr>
                            <tr>
                                <td ><?=lang('product_tjrq')?>：<?=$productFirst['add_time']?></td>
                            </tr>
                        </table>
                    </div>

				</div>
				<!-- contents end -->
			</div>
			<!--right end-->
            <div class="clear"></div>
		</div>
	</div>
</div>

